package com.song.service.Impl;

import com.song.dao.NoticeMapper;
import com.song.pojo.Notice;
import com.song.service.NoticeService;
import com.song.vo.NoticeVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author 宋超
 * HP - the login name of the current user.
 * 2021/5/30 - the current system date.
 * 9:47 - the current system time.
 */
@Service
@Transactional
public class NoticeServiceImpl implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public List<Notice> findNoticeList(NoticeVo noticeVo) {
        return noticeMapper.findNoticeList(noticeVo);
    }


    @Override
    public int addNotice(Notice notice) {
        notice.setCreateDate(new Date());
        return noticeMapper.addNotice(notice);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeMapper.updateNotice(notice);
    }

    @Override
    public int deleteById(Integer id) {
        return noticeMapper.deleteById(id);
    }

    @Override
    public List findAllNoticeList() {
        return noticeMapper.findAllNoticeList();
    }
}
